home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / bob_shadebobs / rnd.i next >
Text File  |  1980-01-03  |  649b  |  47 lines

  1.  
  2.     ****************************************************
  3.     
  4. rndinit:    move.b    $dff007,d0
  5.     asl.w    #8,d0
  6.     move.b    $dff007,d0
  7.     swap    d0
  8.     move.b    $dff007,d0
  9.     asl.w    #8,d0
  10.     move.b    $dff007,d0
  11.     move.l    d0,rndnumber
  12.     rts
  13.     
  14. rnd:    move.l    rndnumber,d1
  15.     and.l    #$0ff00000,d1
  16.     swap    d1
  17.     lsr.w    #4,d1
  18.  
  19.     move.l    rndnumber,d2
  20.     asl.l    #1,d2
  21.     eor.l    #$87654321,d2
  22.     asl.l    #1,d2
  23.     eor.l    d1,d2
  24.     eor.l    #$fedcba97,d2
  25.     add.l    d1,d2
  26.     move.l    d2,rndnumber
  27.     
  28.     move.l    rndnumber,d1
  29.     swap    d1
  30.     and.l    #$0000ffff,d1
  31.     ext.l    d0
  32.     divu    d0,d1
  33.     
  34.     move.w    d1,d2
  35.     ;add.b    $dff007,d2
  36.     ext.l    d2
  37.     add.l    d2,rndnumber
  38.     swap    d1
  39.  
  40.     rts
  41.  
  42. rndnumber:    dc.l    $54d2e507
  43.  
  44.  
  45.     ****************************************************
  46.     
  47.